package com.clpms.dao.mapper;

import com.clpms.dao.pojo.Work;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author caixinyong
 * @date 2023/5/11 8:55 PM
 */

@Mapper
public interface WorkDao {

    List<Work> selectByKeyword(@Param("workType") Integer workType,
                               @Param("courseId") Long courseId,
                               @Param("schoolId") Long schoolId,
                               @Param("teacherId") Long teacherId,
                               @Param("status") Integer status);

    Work selectById(@Param("id") Long id);

    Long selectCountByTeacherId(@Param("teacherId") Long teacherId, @Param("schoolId") Long schoolId);

    Long selectCountByCourseId(@Param("courseId") Long courseId);

    Long selectCountByCourseIdNotStatus(@Param("courseId") Long courseId);

    Long insert(@Param("work") Work work);

    Long deleteByCourseId(@Param("courseId") Long courseId,
                          @Param("schoolId") Long schoolId,
                          @Param("teacherId") Long teacherId);

    Long deleteById(@Param("id") Long id,
                    @Param("schoolId") Long schoolId,
                    @Param("teacherId") Long teacherId);

    Long updateById(@Param("work") Work work);
}
